package com.boomsecret.jvm;

import org.junit.Assert;

import java.util.HashSet;
import java.util.Set;

/**
 * @author wangjinliang on 2019/1/31.
 */
public class JvmDemoTest001 {
    public static void main(String[] args) {
        // -Xms32m -Xmx32m -XX:+PrintHeapAtGC -XX:+HeapDumpOnOutOfMemoryError
        long star = System.currentTimeMillis();
        Set<Integer> hashset = new HashSet<>(100) ;
        for (int i = 0; i < 100000000; i++) {
            hashset.add(i) ;
        }
        Assert.assertTrue(hashset.contains(1));
        Assert.assertTrue(hashset.contains(2));
        Assert.assertTrue(hashset.contains(3));
        long end = System.currentTimeMillis();
        System.out.println("执行时间：" + (end - star));
    }
}
